/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file FormAlarmRing.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef FORMALARMRING_H_
#define FORMALARMTING_H_

#include <FBase.h>
#include <FUi.h>
#include <FMedia.h>
 #include <FSystem.h>

#include "models/SCAlarm.h"
#include "models/SCSession.h"

using namespace Osp::Base;
using namespace Osp::Ui::Controls;
using namespace Osp::Media;
using namespace Osp::System;


class FormAlarmRing :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Media::IPlayerEventListener
{

// Construction
public:
	FormAlarmRing();
	virtual ~FormAlarmRing();
// Constants
	static const int IDA_ALARM_RING_CONFIRM = 200;
	static const int IDA_MARK_ONE			= 201;
	static const int IDA_MARK_TWO			= 202;
	static const int IDA_MARK_THREE			= 203;
	static const int IDA_MARK_FOUR			= 204;
// Attributes
	Label* pTime;
	SCAlarm* pAlarm;
	Player* pPlayer;
	Vibrator* pVibrator;
	SCSession* pLastSession;
	Header* pHeader;
// Methods
public:
	bool Initialize(void);
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual void OnPlayerBuffering (int percent);
	virtual void OnPlayerEndOfClip (void);
	virtual void OnPlayerErrorOccurred (PlayerErrorReason r);
	virtual void OnPlayerInterrupted (void);
	virtual void OnPlayerOpened (result r);
	virtual void OnPlayerReleased (void);
	virtual void OnPlayerSeekCompleted (result r);
	void SetAlarm(SCAlarm* pAlarm);
	SCAlarm* GetAlarm();
	void StartWakeUp();
	void StopWakeUp();
	void StartAwakeType();
	void StartAwakeTask();
	void StartVibration();
	void StartAlarmPlayer();
	int GetFormId();
	void Update();
	void Redraw();
};

#endif /* FORMALARMRING_H_ */
